import React,{memo} from 'react';

import {HeaderTitleDiv} from "./style";
import {NavLink} from "react-router-dom";

export default memo(function HeaderTitle(props) {

    const {titleLink,title,isMore,moreLink}=props;
    return (
        <HeaderTitleDiv>
          <div className="title_div">
            {title}
          </div>
          <ul className="title_ul">
            {
              titleLink? titleLink.map((item)=>{
                  return (<li key={item.title}>
                   <NavLink to={item.link}>{item.title}</NavLink>
                  </li>)
              }):<div/>
            }
          </ul>
          {
            isMore?<div className="title_more">
              <NavLink to={moreLink ?? "/discover/recommend"}>{isMore}</NavLink>
            </div>:<div/>
          }
        </HeaderTitleDiv>
    );
  }
)
